import request from '@/utils/request';
import qs from 'qs';
export function getEnergyPz(query) {
  return request({
    url: '/historicalData/energy/varietyPowerConsumption',
    method: 'GET',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}
export function getEnergyGx(query) {
  return request({
    url: '/historicalData/energy/consumptionOfGongxu',
    method: 'GET',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}
// 电流折线图
export function getElectricLine(query) {
  return request({
    url: '/historicalData/energy/lineChart',
    method: 'GET',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}

// 汇总电耗
export function getHzData(data) {
  return request({
    url: '/energyNew/querySummaryOfPowerConsumptionOfProcess',
    method: 'POST',
    data
  });
}
// 汇总电耗-细纱、络筒
export function getPieData(data) {
  return request({
    url: '/energyNew/querySummaryOfRingXs',
    method: 'POST',
    data
  });
}
//  工序电耗-柱状图
export function getGxChart(data) {
  return request({
    url: '/energyNew/queryProcessPowerConsumption',
    method: 'POST',
    data
  });
}
//  工序电耗-折线图
export function getGxLine(data) {
  return request({
    url: '/energyNew/queryProcessPowerConsumptionLineChart',
    method: 'POST',
    data
  });
}
//  品种电耗-柱状图
export function getPzChart(data) {
  return request({
    url: '/energyNew/queryProcessPowerConsumptionPz',
    method: 'POST',
    data
  });
}
//  品种电耗-折线图
export function getPzLine(data) {
  return request({
    url: '/energyNew/queryProcessPowerConsumptionLineChartPz',
    method: 'POST',
    data
  });
}
//  电耗明细-柱状图
export function getDetail(query) {
  return request({
    url: '/energyNew/queryProcessPowerConsumptionDetail',
    method: 'POST',
    data: query
  });
}
//  电耗明细-折线图
export function getMxLine(query) {
  return request({
    url: '/energyNew/queryProcessPowerConsumptionDetailLineChart',
    method: 'POST',
    data: query
  });
}
